/**
* 子模块路由
* ml
*/

var router = function ($urlRouterProvider, $stateProvider) {

	$stateProvider
		//预存列表
		.state('app.depositList', {
			url: "/deposit/list.html",
			views: {
				'main@': {
					template: require('./views/list.html'),
					controller: 'depositList',
				}
			},
			resolve: {
				list: function (depositservice) {
					return depositservice.list();
				},
				mechanism: function (depositservice) {
					return depositservice.mechanism();
				},
				recharge: function (depositservice) {
					return depositservice.recharge();
				},
				trackinfo: function (depositservice) {
					return depositservice.trackinfo();
				},
				update: function (depositservice) {
					return depositservice.update();
				},
				getSellerInfoByCode: function (depositservice) {
					return depositservice.getSellerInfoByCode();
				},
				transData: function (utilservice) {
					return utilservice.transData;
				}
			}
		})

		//创建预存
		.state('app.depositCreate', {
			url: "/deposit/create.html",
			views: {
				'main@': {
					template: require('./views/deposit.html'),
					controller: 'depositCreate',
				}
			},
			resolve: {
				create: function (depositservice) {
                    return depositservice.create();
                },
                talist: function (depositservice) {
                    return depositservice.talist;
                }
			}
		})

		//供应商预存管理
		.state('app.supplier_deposit', {
			url: "/supplier/deposit",
			views: {
				'main@': {
					template: require('./views/supplierDeposit.html'),
					controller: 'supplierDeposit',
				}
			},
			resolve: {
				
			}
		})

		//分销商预存管理
		.state('app.distributor_deposit', {
			url: "/distributor/deposit",
			views: {
				'main@': {
					template: require('./views/distributorDeposit.html'),
					controller: 'distributorDeposit',
				}
			},
			resolve: {
				
			}
		})

		//平台预存管理
		.state('app.platform_deposit', {
			url: "/platform/deposit",
			views: {
				'main@': {
					template: require('./views/platformDeposit.html'),
					controller: 'platformDeposit',
				}
			},
			resolve: {
				
			}
		})

		//分润信息
		.state('app.profitList', {
			url: "/profit/list",
			views: {
				'main@': {
					template: require('./views/profitList.html'),
					controller: 'profitList',
				}
			},
			resolve: {
				
			}
		})

		//交易记录
		.state('app.transaction', {
			url: "/transaction/list/:supplier_company_code/:seller_code",
			views: {
				'main@': {
					template: require('./views/transaction.html'),
					controller: 'transaction',
				}
			},
			resolve: {
			}
		})

		//交易订单详情
		.state('app.transactionInfo', {
			url: "/transactionInfo",
			views: {
				'main@': {
					template: require('./views/transactionInfo.html'),
					controller: 'transactionInfo',
				}
			},
			resolve: {

			}
		})
		
};

module.exports = router;